<template>
  <div class="ke-comment">
    <ul class="wrapper">
      <li v-for="(item, index) in commentList" :key="index">
        <div class="left">
          <img :src="item.avatar" />
          <div class="nickName">{{item.nickName}}</div>
        </div>
        <div class="right">
          <div class="score">
            <el-rate
              v-model="item.score"
              disabled
              show-score
              text-color="#ff9900"
              score-template="{value}"
            ></el-rate>
          </div>
          <div class="content">{{item.content}}</div>
        </div>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  name: 'ke-comment',
  data() {
    return {
      commentList: [
        {
          avatar: require('../../assets/images/linux.jpg'),
          nickName: '玛丽亚',
          score: 5,
          content: 'hello jane'
        },
        {
          avatar: require('../../assets/images/linux.jpg'),
          nickName: '简',
          score: 4,
          content: 'hello lihua'
        },
        {
          avatar: require('../../assets/images/linux.jpg'),
          nickName: '李华',
          score: 4.6,
          content: 'hello kangkang'
        },
        {
          avatar: require('../../assets/images/linux.jpg'),
          nickName: '康康',
          score: 3.5,
          content: 'hello michael'
        },
        {
          avatar: require('../../assets/images/linux.jpg'),
          nickName: '迈克',
          score: 3.2,
          content: 'hello maria'
        }
      ]
    }
  }
}
</script>

<style lang="stylus" scoped>
.ke-comment {
  position: relative;
  width: 830px;

  .wrapper {
    padding: 0;
    overflow: scroll;
    -ms-overflow-style: none;

    &::-webkit-scrollbar {
      width: 0px;
    }

    li {
      position: relative;
      list-style: none;
      overflow: hidden;
      height: 112px;
      box-sizing: border-box;
      padding: 20px 20px 20px 80px;
      border-bottom: 1px solid #dddddd;

      &:last-child {
        border-bottom: none;
      }

      .left {
        position: absolute;
        width: 80px;
        top: 20px;
        left: 0;
        text-align: center;
        font-size: 14px;
        color: #333333;

        img {
          width: 40px;
          height: 40px;
          border-radius: 50%;
        }
      }

      .right {
        .score {
          margin-top: 10px;
        }

        .content {
          min-height: 28px;
          margin-bottom: 10px;
          font-size: 14px;
          line-height: 1.5;
          color: #333333;
        }
      }
    }
  }
}
</style>
